package cn.edu.gduf.luowowo.search.query;

import cn.edu.gduf.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;

@Setter
@Getter
public class SearchQueryObject extends QueryObject {
    public static final int SEARCH_TYPE_ALL = -1; //查全部
    public static final int SEARCH_TYPE_DESTINATION = 0; //查目的地
    public static final int SEARCH_TYPE_STRATEGY = 1; //查攻略
    public static final int SEARCH_TYPE_TRAVEL = 2; //查游记
    public static final int SEARCH_TYPE_USER = 3; //查用户

    private int type = SEARCH_TYPE_ALL;

    public Pageable getPageable() {
        return PageRequest.of(super.getCurrentPage() - 1, super.getPageSize());
    }
}
